package cn.chinaflame.pagodas.req;

import cn.chinaflame.pagodas.enums.CodeEnum;
import cn.chinaflame.pagodas.utils.ParamPreconditions;

import java.math.BigDecimal;

/**
 * 订单详情添加请求
 *
 * @author bm
 * 2018年1月13日 下午2:19:02
 */
public class PaOrderItemAddReq extends BaseReq {

    private String goodsId;//商品id
    private String itemId;  //项目id
    private String areaId;  //区域id
    private String positionId; //位置id
    private Integer term;        //天数
    private BigDecimal price;   //价格
    private Integer number;  //商品数量


    @Override
    public void check() {
        //商品流程变动，展示修改
//        ParamPreconditions.checkNotEmpty(areaId, CodeEnum.FAIL.getCode(), "区域id不能为空");
//        ParamPreconditions.checkNotEmpty(positionId, CodeEnum.FAIL.getCode(), "位置id不能为空");
        ParamPreconditions.checkArgument(term != null && term >= 1, CodeEnum.FAIL.getCode(), "天数不能为空");
//        ParamPreconditions.checkArgument(number != null && number > 0, CodeEnum.FAIL.getCode(), "商品数量不能为空");
        ParamPreconditions.checkPriceValid(price);
    }

    public Integer getTerm() {
        return term;
    }

    public void setTerm(Integer term) {
        this.term = term;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    public String getItemId() {
        return itemId;
    }

    public void setItemId(String itemId) {
        this.itemId = itemId;
    }

    public String getAreaId() {
        return areaId;
    }

    public void setAreaId(String areaId) {
        this.areaId = areaId;
    }

    public String getPositionId() {
        return positionId;
    }

    public void setPositionId(String positionId) {
        this.positionId = positionId;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

}
